#include "user_main.h"
#include "ti_msp_dl_config.h"
#include "./order_sensor/order_sensor_app.h"
#include "./order_sensor/order_sensor_bsp.h"
#include "./board_g3507/bsp_g3507std.h"


//////////////////////////////////////////////////////////////////////////
// Timer

// tick
volatile uint32_t g_ticks = 0;
volatile uint32_t g_ticks_inc = 0;

void SysTick_Handler(void)
{
    g_ticks++;
    g_ticks_inc++;
}

static void _user_init( void )
{    

}

int main(void)
{
    SYSCFG_DL_init();

    order_sensor_init();
    _user_init();


    while (1) {
        if ( g_ticks  >= 1 ) {    // 1 ms per circle
            g_ticks =0;

            dac_dma_output_sinesignal(gOutputSignalSine64, sizeof(gOutputSignalSine64) / sizeof(uint16_t));

            order_sensor_act( g_g3507_board_order_array, g_g3507_board_sensor_array, G3507_BOARD_SENSOR_ARRAY_LEN); 

            g3507_board_set_order(  g_g3507_board_order_array  , 15 );
            g3507_board_get_sensor( g_g3507_board_sensor_array , 10 );

        }
    }
}




